<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnMarkModifyInNoteTable extends AbstractMigration
{
    public function up()
    {
        $this->table('note')
            ->addColumn('mark_modify', 'enum', ['values' => 'yes,no', 'default' => 'no', 'comment' => '标记必改'])
            ->addColumn('demand_status', 'enum', ['values' => 'default,pending,processing,final,rejected', 'default' => 'default', 'comment' => '需求状态(default默认,pending待发起返修,processing进行中,final已完成,rejected拒绝)'])
            ->addColumn('review_feedback_id', 'integer', ['limit' => 11, 'default' => 0, 'null' => false, 'comment' => '审核反馈id'])
            ->addColumn('task_repair_order_id', 'integer', ['limit' => 11, 'default' => 0, 'null' => false, 'comment' => '返修单id'])
            ->save();
    }

    public function down()
    {
        $this->table('note')
            ->removeColumn('mark_modify')
            ->removeColumn('demand_status')
            ->removeColumn('review_feedback_id')
            ->removeColumn('task_repair_order_id')
            ->save();
    }
}
